#coding=utf-8
from urllib.parse import  quote
import time

BASE_URI = "http://datacenter.mep.gov.cn/report/air_daily/air_dairy.jsp?city=%s&startdate=%s&enddate=%s&page=%s"
BASE_LOCAL_PATH= "./city" 

def today():
    t_struct = time.gmtime()
    return "-".join([ str(i) for i in  [t_struct.tm_year ,t_struct.tm_mon,t_struct.tm_mday] ])

def get_time(year,mon,day):
    return "-".join([ str(i) for i in  [year ,mon,day] ])



def config_paras(city,date,page):
    """
    (sample):
    city :  quote("北京市")
    date : (2015-12-2 , 2015-12-24)
    page : 1

    """
    return BASE_URI % (city,date[0],date[1],page)
